# -*- coding: utf-8 -*-

import sys
import profile


def fibonacci(n):
    """斐波拉契"""
    if n == 0:
        # 第一个值
        return 0
    elif n == 1:
        # 第二个值
        return 1
    else:
        # 递归调用
        return fibonacci(n - 1) + fibonacci(n - 2)
    pass


def fibonacci_sequence(n):
    """斐波拉契数列"""
    seq = []
    if n > 0:
        seq.extend(fibonacci_sequence(n - 1))
    seq.append(fibonacci(n))
    return seq


def py_profile(frame, event, param):
    print("profile:%r %r %r" % (frame, event, param,))

    pass


def py_profile_run():
    profile.run('write_aline("logs/1.log", datetime.datetime.now().strftime("%Y-%m-%d"))')
    pass


if __name__ == '__main__':
    """
    
    """
    sys.setprofile(py_profile)

    # py_profile_run()

    pass
